package bancosys.tec.persist.base.persister;

import bancosys.tec.persist.PersistTestController;
import bancosys.tec.persist.base.domain.AuthTestBean;
import bancosys.tec.persist.persister.DefaultPersister;

/**
 * @created Feb 8, 2007
 * @author Gustavo Almeida
 */
public class AuthTestBeanPersister extends DefaultPersister<AuthTestBean> {
    public enum BusinessMethods {
        delete, insert, update
    };

    @Override
    public void beforeRemove(AuthTestBean bean) {
        PersistTestController controller = (PersistTestController) bean.getController();
        controller.addBusinessMethod(BusinessMethods.delete);
    }

    @Override
    public void beforeInsert(AuthTestBean bean) {
        PersistTestController controller = (PersistTestController) bean.getController();
        controller.addBusinessMethod(BusinessMethods.insert);
    }

    @Override
    public void beforeUpdate(AuthTestBean bean) {
        PersistTestController controller = (PersistTestController) bean.getController();
        controller.addBusinessMethod(BusinessMethods.update);
    }

}
